Skip to content

Add newsletter image upload CLI/API, course banner resolution, and sponsor graphic auto-insert - #444

Merged
alexeygrigorev merged 2 commits into
mainfrom
hub/intake-e106f3aa1078aaa02c804b9175a1217e63585ab6feddbd0f0f573be9c0a242ce
Nov 13, 2026
Merged

alexeygrigorev merged 2 commits into
mainfrom
hub/intake-e106f3aa1078aaa02c804b9175a1217e63585ab6feddbd0f0f573be9c0a242ce

Conversation

@alexeygrigorev

Copy link
Copy Markdown
Member

Summary

  • Add POST /api/newsletter-issues/:id/images reusing savePublicImage (with full image decode and dimension validation from PR Validate sponsor graphic uploads, remove silent 300k slice, and alert on failures #440) to store durable public newsletter images in S3 (/api/public-images/:id).
  • Add dataops newsletter image upload <issue-id> <path> CLI command (with --help and cli/skill/SKILL.md docs) that uploads an image and prints its durable public https:// URL.
  • Update backend/src/newsletter/markdownPreview.ts to:
    • Render linked images ([![alt](src)](href)) as clickable <figure> elements.
    • Resolve known [Banner: Course name] markers (AI Dev Tools Zoomcamp, Machine Learning Zoomcamp) to their public course banners without inventing missing banners (Production AI Agents for Generative Media, event posters, recording thumbnails).
    • Auto-insert the linked sponsor doc's hosted graphicsUrl with its tracked ctaUrl into the SPONSORED block of the newsletter issue preview when no image is already present.
  • Add cli/scripts/migrate-sponsor-doc-images.mjs to migrate data:image/...;base64,... sponsor graphicsUrl values to hosted storage (and support --replace <doc-id>=<path> for truncated legacy uploads).

Test Plan

  • NODE_ENV=test FRONTEND_ROOT=../frontend SKIP_AUTH=true node --import tsx --test backend/tests/newsletter-markdown.test.ts backend/tests/public-images.test.ts (6/6 passing)
  • npm --prefix backend run typecheck (passing)
  • npm --prefix cli test (613/613 passing)

@alexeygrigorev
alexeygrigorev merged commit 0cd7087 into main Nov 13, 2026
4 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant